<template>
  <div
      class="avatar"
      :style="{
      width: width + 'px',
      height: width + 'px',
      'border-radius': width / 2 + 'px',
    }"
  >
    <el-image
        :style="{
        width: width + 'px',
        height: width + 'px',
        'border-radius': width / 2 + 'px',
      }"
        :src="src"
        fit="cover"
        loading="lazy"
    >
    </el-image>
  </div>
</template>

<script setup>
const props = defineProps({
  width: {
    type: Number,
    default: 60,
  },
  addLink: {
    type: Boolean,
    default: true,
  },
  src: {
    type: String,
    default: "https://himg.bdimg.com/sys/portrait/item/public.1.64e39450.RhBOr2ccVDKVT7UyHDoKtg.jpg?_d=29299990",
  },
});

</script>

<style lang="scss">
.avatar {
  display: flex;
  cursor: pointer;
  background: #f0f0f0;
  align-items: center;
  overflow: hidden;
  .no-login {
    width: 100%;
    text-align: center;
    font-size: 13px;
  }
}
</style>